//##############################################################################
//#    CuteWebshot is an application which can be used to render
//#    screenshots from webpages.
//#
//#    Copyright (C) 2010  Juhapekka Piiroinen
//#
//#    This program is free software: you can redistribute it and/or modify
//#    it under the terms of the GNU General Public License as published by
//#    the Free Software Foundation, either version 3 of the License, or
//#    (at your option) any later version.
//#
//#    This program is distributed in the hope that it will be useful,
//#    but WITHOUT ANY WARRANTY; without even the implied warranty of
//#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//#    GNU General Public License for more details.
//#
//#    You should have received a copy of the GNU General Public License
//#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//#############################################################################
//# Contact: juhapekka.piiroinen@gmail.com
//#############################################################################
#include <QtGui/QApplication>
#include "mainwindow.h"


int main(int argc, char *argv[])
{
    FUNC_IN;
        QApplication* a = new QApplication(argc, argv);

        //////////////////////////////////////
        // lets initialize the application details
        QCoreApplication::setOrganizationName("Juhapekka Piiroinen");
        QCoreApplication::setOrganizationDomain("jpii.fi");
        QCoreApplication::setApplicationName("CuteWebshot");

        MainWindow* w = new MainWindow();
        w->show();

        ///////////////////////////////////////
        // FIXME: confirm if this works at all. :-) ..at least not in ubuntu.
        a->connect(a,SIGNAL(commitDataRequest(QSessionManager&)),w,SLOT(commitData(QSessionManager&)));
        // this works at least :p ..but user interaction is not enabled/allowed.
        a->connect(a,SIGNAL(saveStateRequest(QSessionManager&)),w,SLOT(commitData(QSessionManager&)));

        int retval = a->exec();

        delete w;
        delete a;

    FUNC_OUT;
    return retval;
}
